package com.bigger.arch.app.dto;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.*;
import java.util.Date;

public class UserDto {
    @NotNull
    @Size(min = 5, max = 10)
    private String name;

    @Min(value = 18)
    @Max(value = 35)
    private int age;

    @NotNull
    @Past(message = "创建时间必须是过去时间")
    //JsonFormat针对springcloud日期反序列化报错的问题
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }
}
